//
//  LMNavigationBar.swift
//  WeiBo
//
//  Created by Li MAc on 2018/11/14.
//  Copyright © 2018 Li MAc. All rights reserved.
//

import UIKit

class LMNavigationBar: UINavigationBar {

    //Swift自定义导航栏的问题
    
    override func layoutSubviews() {
        super.layoutSubviews()
        
        for subview in self.subviews {
            let stringFromClass = NSStringFromClass(subview.classForCoder)
            print("--------- \(stringFromClass)")
            if stringFromClass.contains("BarBackground") {
                subview.frame = self.bounds
            } else if stringFromClass.contains("UINavigationBarContentView") {
                subview.frame = CGRect(x: 0, y: 20, width: UIScreen.cz_screenWidth(), height: 44)
            }
        }
    }


}
